import request from "@/utils/requestExam";

// 查询题库列表
export function listQuestionBank(query) {
  return request({
    url: '/api/uf/boostor/exam/question/ExamBankRest/searchByPage/v1',
    method: 'post',
    data: query
  })
}

// 根据项目代码查询所属题库
export function getQuestionBankByProjectCode(projectCode) {
  return request({
    url: '/api/uf/boostor/exam/question/ExamBankRest/selectByProjectCode/' + projectCode,
    method: 'get'
  })
}

// 根据题库ID查询题库详细信息
export function getQuestionBankById(id) {
  return request({
    url: '/api/uf/boostor/exam/question/ExamBankRest/selectQuestionBankById/' + id,
    method: 'get'
  })
}

// 根据题库ID查询题库规则详细信息
export function getQuestionBankRuleById(id) {
  return request({
    url: '/api/uf/boostor/exam/question/ExamBankRest/bankRule/' + id,
    method: 'get'
  })
}

// 新增题库信息
export function addQuestionBank(data) {
  return request({
    url: '/api/uf/boostor/exam/question/ExamBankRest/add/v1',
    method: 'post',
    data: data
  })
}

// 新增题库规则
export function addBankRule(data) {
  return request({
    url: '/api/uf/boostor/exam/question/ExamBankRest/add/bankRule/v1',
    method: 'post',
    data: data
  })
}

// 修改题库信息
export function updateQuestionBank(data) {
  return request({
    url: '/api/uf/boostor/exam/question/ExamBankRest/edit/v1',
    method: 'put',
    data: data
  })
}

// 删除题库信息
export function delQuestionBank(projectCodes) {
  return request({
    url: '/api/uf/boostor/exam/question/ExamBankRest/remove/' + projectCodes,
    method: 'delete'
  })
}

// 下载题库导入模板
export function importTemplate() {
  return request({
    url: '/api/uf/boostor/exam/question/ExamBankRest/importTemplate/v1',
    method: 'get'
  })
}

// 导出题库
export function exportQuestionBank(data) {
  return request({
    url: '/api/uf/boostor/exam/question/ExamBankRest/export/v1',
    method: 'post',
    data: data
  })
}

// 查询题库列表
export function getQuestionBankList(query) {
  return request({
    url: '/api/uf/boostor/exam/question/ExamBankRest/getQuestionBankList/v1',
    method: 'post',
    data: query
  })
}
